We can end up in situations where NULL gets passed to
get_transient_parent(). Embrace it instead of avoiding it.
https://bugzilla.gnome.org/show_bug.cgi?id=758327
static GdkWindow *
get_popup_parent (GdkWindow *window)
{
- do
+ while (window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
window = impl->transient_for;
}
- while (window);
return NULL;
}
}
if (transient_for)
- transient_for = gdk_window_get_toplevel (transient_for);
- if (transient_for)
- transient_for = get_popup_parent (transient_for);
+ transient_for = get_popup_parent (gdk_window_get_toplevel (transient_for));
/* If the position was not explicitly set, start the popup at the
* position of the device that holds the grab.